home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / tex-k / tex-k-archive.past / tex-k-archive.gz / tex-k-archive / 000102_R.Kooijman@et.tudelft.nl_Mon Dec 6 12:16:33 1993.msg < prev    next >
Internet Message Format  |  1994-10-11  |  6KB

  1. Received: from dutepp6.et.tudelft.nl by cs.umb.edu with SMTP id AA29257
  2.   (5.65c/IDA-1.4.4 for <tex-k@cs.umb.edu>); Mon, 6 Dec 1993 06:47:38 -0500
  3. Received: by dutepp6.et.tudelft.nl id AA25978
  4.   (5.67a/IDA-1.5 for tex-k@cs.umb.edu); Mon, 6 Dec 1993 11:22:20 +0100
  5. Date: Mon, 6 Dec 1993 11:16:33 +0100 (MET)
  6. From: Richard Kooijman <R.Kooijman@et.tudelft.nl>
  7. Subject: Re: Getting Virtual Fonts to work
  8. To: tex-k@cs.umb.edu
  9. In-Reply-To: <Pine.3.07.9312060755.A5155-b100000@dutepp13.et.tudelft.nl>
  10. Message-Id: <Pine.3.07.9312061131.A25974-d100000@dutepp6.et.tudelft.nl>
  11. Mime-Version: 1.0
  12. Content-Type: TEXT/PLAIN; charset=US-ASCII
  13.  
  14. On Mon, 6 Dec 1993, Richard Kooijman wrote:
  15.  
  16. > Let me know if you want to have a copy of that MakeTeXPK. If there
  17. > are a lot of requests I will post it here.
  18.  
  19.  
  20. OK, here it is. I used xdvik's MakeTeXPK and put in the PS font
  21. generation part of xdvi-beta's MakeTeXPK. Maybe some small edits
  22. by me but nothing special.
  23. You'll need ghostscript and its fonts.
  24. BTW as default, xdvik only generates fonts if you specify +maketexpk on the
  25. command-line or if you have set this in your .Xdefaults.
  26. Some fonts may generate lots of warnings, I can't help that, seems like
  27. certain (special) characters are not defined in those fonts.
  28.  
  29. Good luck.
  30.  
  31.  
  32. Richard.
  33. -------------------------------------------------------
  34. #!/bin/sh
  35. # MakeTeXPK -- make a new PK font, because one wasn't found.
  36. # (If you change or delete the word `original' on the previous line,
  37. # dvips won't install its MakeTeXPK over yours.)
  38. # Parameters are:
  39. #
  40. #   name dpi bdpi magnification [mode]
  41. #
  42. #   `name' is the base name of the font, such as `cmr10'.
  43. #   `dpi' is the resolution the font is needed at.
  44. #   `bdpi' is the base resolution, useful for intuiting the mode to use.
  45. #   `magnification' is a string to pass to MF as the value of `mag'.
  46. #   `mode', if supplied, is the mode to use.
  47. #
  48. # This script must echo the name of the generated PK file (and nothing
  49. # else) to standard output.
  50.  
  51. echo "Running MakeTeXPK $*." 1>&2
  52.  
  53. TEXDIR=/usr/local/lib/tex
  54.  
  55. # Where to put the new files.
  56. DESTDIR=$TEXDIR/fonts/pk
  57.  
  58. # Postscript fonts map file.
  59. MAPFILE=$TEXDIR/ps/psfonts.map
  60.  
  61. # If this directory doesn't exist, the Sauter stuff won't be attempted.
  62. sauterdir=$TEXDIR/sauter
  63.  
  64. # TEMPDIR needs to be unique for each process because of the possibility
  65. # of simultaneous processes running this script.
  66. TEMPDIR=/tmp/mtpk.$$
  67.  
  68. NAME=$1
  69. DPI=$2
  70. BDPI=$3
  71. MAG=$4
  72. MODE=$5
  73.  
  74. umask 0
  75.  
  76. # If an explicit mode is not supplied, try to guess.
  77. if test -z "$MODE"; then
  78.   case "$BDPI" in
  79.     85) MODE=sun;;
  80.    118) MODE=lview;;
  81.    300) MODE=CanonCX;;
  82.   1270) MODE=LinotypeOneZeroZero;;
  83.      *) echo "MakeTeXPK doesn't have a guess for $BDPI dpi devices." 1>&2
  84.         echo "Put the mode in a config file, or update MakeTeXPK." 1>&2
  85.         exit 1
  86.   esac
  87. fi
  88.  
  89. GFNAME=$NAME.$DPI'gf'
  90. PKNAME=$NAME.$DPI'pk'
  91.  
  92. # Clean up on normal or abnormal exit
  93. trap "cd /; rm -rf $TEMPDIR $DESTDIR/pktmp.$$" 0 1 2 15
  94.  
  95. # Do we have a GF file in the current directory?
  96. if test -r $GFNAME; then
  97.   echo "Running gftopk ./$GFNAME $PKNAME." 1>&2
  98.   gftopk ./$GFNAME $PKNAME
  99.   # Don't move the font; if the person knows enough to make fonts, they
  100.   # know enough to have . in the font paths.
  101.   echo $PKNAME
  102.   exit 0
  103. fi
  104.  
  105. # Do we have an F3 font?
  106. # You will need Sun's f3tobm program, plus a program I wrote.
  107. # See ftp.cs.umb.edu:private/f3totex.
  108. dtrg=/u/zapf/dtrg
  109. if test -r $dtrg/typescaler/fonts/f3b/$NAME.f3b; then
  110.   echo "Trying f3topk -r $DPI $NAME." 1>&2
  111.   PATH=$dtrg/src/`arch`/bin:$PATH
  112.   export PATH
  113.   cd $dtrg/fonts
  114.   if f3topk -r $DPI $NAME; then
  115.     echo $PKNAME
  116.     exit 0
  117.   else
  118.     echo "f3topk failed." 1>&2
  119.     exit 1
  120.   fi
  121. fi
  122.  
  123. # No special case applies.  Try Metafont.  Since we want to run it in a
  124. # temporary directory, add the current directory to MFINPUTS.
  125. MFINPUTS=`pwd`:${MFINPUTS}:
  126. export MFINPUTS
  127.  
  128. test -d $TEMPDIR || mkdir $TEMPDIR 
  129. cd $TEMPDIR || exit 1
  130.  
  131. if test -r $DESTDIR/$PKNAME; then
  132.   echo "$DESTDIR/$PKNAME already exists!" 1>&2
  133.   echo $DESTDIR/$PKNAME
  134.   exit 0
  135. fi
  136.  
  137. # Which version of Metafont shall we use?
  138. case $NAME in
  139.   cm*) mf=cmmf;;
  140.   *) mf=mf;;
  141. esac
  142.  
  143. if egrep \^$NAME'([     ]|$)' $MAPFILE > /dev/null; then
  144.   echo "Running gsftopk $NAME $DPI." 1>&2
  145.   gsftopk $NAME $DPI 1>&2
  146. else
  147.   # Run Metafont. 
  148.   unset DISPLAY
  149.   echo "Running $mf \mode:=$MODE; mag:=$MAG; scrollmode; input $NAME." 1>&2
  150.   $mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" </dev/null 1>&2
  151.   
  152.   if test $d $sauterdir && test $? -eq 1 && test $mf = cmmf; then
  153.     # Perhaps no such MF source file, and it's CM.  Try Sauter's scripts.
  154.     cd $sauterdir
  155.     rootfont=`echo $NAME | sed 's/[0-9]*$//'`
  156.     pointsize=`echo $NAME | sed 's/cm[a-z]*//'`
  157.     make-mf $rootfont $pointsize
  158.     echo "Trying interpolated/extrapolated (Sauter) CM source." 1>&2
  159.     $mf "\mode:=$MODE; mag:=$MAG; scrollmode; input mf/$NAME" </dev/null
  160.     if test $? -eq 0 && test -r $GFNAME; then
  161.       mv $GFNAME $TEMPDIR
  162.     fi
  163.     rm -f $NAME.log mf/$NAME
  164.     cd $TEMPDIR
  165.   fi
  166.   
  167.   if test ! -r $GFNAME; then
  168.     # Maybe it succeeded at DPI +- 1?
  169.     test_dpi=`expr $DPI - 1`
  170.     test_name=$NAME.${test_dpi}
  171.     if test -r ${test_name}gf; then
  172.       GFNAME=${test_name}gf
  173.       PKNAME=${test_name}pk
  174.     else
  175.       test_dpi=`expr $DPI + 1`
  176.       test_name=$NAME.${test_dpi}
  177.       if test -r ${test_name}gf; then
  178.         GFNAME=${test_name}gf
  179.         PKNAME=${test_name}pk
  180.       else
  181.         echo "MakeTeXPK failed to make $GFNAME." 1>&2
  182.         exit 1
  183.       fi
  184.     fi
  185.   fi
  186.   
  187.   # We succeeded.  Make the PK file.
  188.   gftopk ./$GFNAME $PKNAME
  189. fi
  190.  
  191. test -d $DESTDIR \
  192.   || mkdir $DESTDIR \
  193.   || (echo "${DESTDIR}: Could not create directory." 1>&2; exit 1)
  194.  
  195. # Install the PK file carefully, since others may be doing the same
  196. # as us simultaneously.
  197. mv $PKNAME $DESTDIR/pktmp.$$ \
  198.   || (echo "Could not mv $PKNAME $DESTDIR/pktmp.$$." 1>&2; exit 1)
  199.  
  200. cd $DESTDIR
  201. mv pktmp.$$ $PKNAME
  202. echo $DESTDIR/$PKNAME
  203.  
  204.